<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<meta name="viewport" content="maximum-scale=1.0,minimum-scale=1.0,user-scalable=0,width=device-width,initial-scale=1.0"/>
<title>商品列表</title>
<link rel="stylesheet" type="text/css" href="../css/api.css"/>
<link rel="stylesheet" type="text/css" href="../css/common.css"/>
<link rel="stylesheet" type="text/css" href="../css/product.css"/>
<link rel="stylesheet" type="text/css" href="../css/fakeLoader.css">
<script src="../script/jquery-1.8.3.min.js"></script>
</head>
<body>
<div class="fakeloader"></div>

<div id="wrap1">
    <div id="header">
        <div class="back" tapmode="topbar-active">
            <i class="i-back"></i>
        </div>
        <div class="flex-full">旺铺1元抢购(休闲店)</div>
       
        <div class="search" tapmode="topbar-active">
            <i class="i-search"></i>
        </div>
    </div>
    <div id="pref-info" class="pref-info">
        <i class="icon-tips"></i><strong>活动中心：</strong>新品鱼鲜羊杂限量公测中!
    </div>
    <div id="asidewrap" class="asidewrap">
            <div class="taglist" style=" height:800px;">            
                <div class="j-tag tag focus" style=" margin-top:0px;">
                    <div class="tag-inner">
                    <a href="#" data-group-id="10">
                    	<i class="tag-cate1"></i>
                        <span class="tag-text"> 新品区</span>
                     </a>
                    </div>
                   
           		 </div>
                 <div class="j-tag tag">
                    <div class="tag-inner">
                     <a href="#" data-group-id="11">
                    	<i class="tag-cate2"></i>
                        <span class="tag-text"> 单品区</span>
                      </a>   
                    </div>
           		 </div>
                 <div class="j-tag tag">
                    <div class="tag-inner">
                     <a href="#" data-group-id="12">
                    	<i class="tag-cate3"></i>
                        <span class="tag-text"> 迷你区</span>
                      </a>   
                    </div>
           		 </div>
                 <div  class="j-tag tag">
                    <div class="tag-inner">
                     <a href="#" data-group-id="13">
                    	<i class="tag-cate4"></i>
                        <span class="tag-text"> 品牌专区</span>
                      </a>   
                    </div>
           		 </div>
                 <div class="j-tag tag">
                    <div class="tag-inner">
                     <a href="#" data-group-id="14">
                   		<i class="tag-cate5"></i>
                        <span class="tag-text"> 套餐区</span>
                      </a>   
                    </div>
           		 </div>
                 <div class="j-tag tag">
                    <div class="tag-inner">
                     <a href="#" data-group-id="15">
                    	<i class="tag-cate6"></i>
                        <span class="tag-text"> 配餐区</span>
                     </a>
                    </div>
           		 </div>
                  <div class="j-tag tag">
                    <div class="tag-inner">
                     <a href="#" data-group-id="16">
                    	<i class="tag-cate7"></i>
                        <span class="tag-text"> 甜品区</span>
                     </a>
                    </div>
           		 </div>
                         
            </div>
		</div>
		<div id="mainwrap" class="mainwrap" >
            <div class="foodlistwrap">
            	<h3 class="foodlist-label">新品区 </h3>
                <ul>
                    <li class="j-fooditem fooditem" style="padding-top:0px;">
                    <div class="food-content1 clearfix">
                        <div class="food-pic-wrap">
                        <img class="j-food-pic food-pic" src="../image/sp1.jpg" visibility="hidden">
                        <span class="items-item-sold">621人吃过</span>
                        </div>
                        <div class="food-cont">
                            <div class="j-foodname foodname">辣子鸡饭</div>
                            <div class="j-item-console foodop clearfix">
                                <a class="j-add-item add-food" href="javascript:;">
                               		<i class="icon i-add-food j-add-inner"></i>
                                </a>
                                <span class="j-item-num foodop-num" style="display:none">0</span>
                                <a class="j-remove-item remove-food" style="display:none" href="javascript:;">
                                	<i class="icon i-remove-food"></i>
                                </a>
                            </div>
                            <div class="food-price-region">
                            	<span class="food-price">{$setting['currency']}<font>13</font></span>
                            </div>
                        </div>
                       	</div>
                    </li>
                     <li class="j-fooditem fooditem">
                    <div class="food-content1 clearfix">
                        <div class="food-pic-wrap">
                        <img class="j-food-pic food-pic" src="../image/sp2.jpg" visibility="hidden">
                        <i class="items-item-soldout"></i>
                        <span class="items-item-sold">621人吃过</span>
                        </div>
                        <div class="food-cont">
                            <div class="j-foodname foodname">辣子鸡饭</div>                     
                            <div class="j-item-console foodop clearfix">
                                <a class="food-yd"  href="">
                               	预定
                                </a>
                            </div>
                            <div class="food-price-region">
                            	<span class="food-price">{$setting['currency']}<font>16</font></span>
                            </div>
                        </div>
                       	</div>
                    </li>
                     <li class="j-fooditem fooditem">
                    <div class="food-content1 clearfix">
                        <div class="food-pic-wrap">
                        <img class="j-food-pic food-pic" src="../image/sp1.jpg" visibility="hidden">
                        
                        <span class="items-item-sold">621人吃过</span>
                        </div>
                        <div class="food-cont">
                            <div class="j-foodname foodname">辣子鸡饭</div>
                            <div class="j-item-console foodop clearfix">
                                <a class="food-yd"  href="">
                               	可选规格
                                </a>
                            </div>
                            <div class="food-price-region">
                            	<span class="food-price">{$setting['currency']}<font>33</font></span>
                            </div>
                        </div>
                       	</div>
                    </li>
                    
                </ul>
          
                  <h3 class="foodlist-label">单品区 </h3>
                <ul>
                	 <li class="j-fooditem fooditem">
                    <div class="food-content1 clearfix">
                        <div class="food-pic-wrap">
                        <img class="j-food-pic food-pic" src="../image/sp2.jpg" visibility="hidden">
                        </div>
                        <div class="food-cont">
                            <div class="j-foodname foodname">辣子鸡饭</div>
                            <div class="j-item-console foodop clearfix">
                                <a class="j-add-item add-food" href="javascript:;" >
                               		<i class="icon i-add-food j-add-inner"></i>
                                </a>
                                <span class="j-item-num foodop-num" style="display:none">0</span>
                                <a class="j-remove-item remove-food" style="display:none" href="javascript:;">
                                	<i class="icon i-remove-food"></i>
                                </a>
                            </div>
                            <div class="food-price-region">
                            	<span class="food-price">{$setting['currency']}<font>22</font></span>
                            </div>
                        </div>
                       	</div>
                    </li>
                    <li class="j-fooditem fooditem" style="padding-top:0px;">
                    <div class="food-content1 clearfix">
                        <div class="food-pic-wrap">
                        <img class="j-food-pic food-pic" src="../image/sp1.jpg" visibility="hidden">
                        </div>
                        <div class="food-cont">
                            <div class="j-foodname foodname">辣子鸡饭</div>
                            <div class="j-item-console foodop clearfix">
                                <a class="j-add-item add-food" href="javascript:;">
                               		<i class="icon i-add-food j-add-inner"></i>
                                </a>
                                <span class="j-item-num foodop-num" style="display:none">0</span>
                                <a class="j-remove-item remove-food" style="display:none" href="javascript:;">
                                	<i class="icon i-remove-food"></i>
                                </a>
                            </div>
                            <div class="food-price-region">
                            	<span class="food-price">{$setting['currency']}<font>13</font></span>
                            </div>
                        </div>
                       	</div>
                    </li>
                  </ul>
               
                  <h3 class="foodlist-label">迷你区 </h3>
                <ul>
                	 <li class="j-fooditem fooditem">
                    <div class="food-content1 clearfix">
                        <div class="food-pic-wrap">
                        <img class="j-food-pic food-pic" src="../image/sp2.jpg" visibility="hidden">
                        <i class="items-item-soldout"></i>
                        <span class="items-item-sold">621人吃过</span>
                        </div>
                        <div class="food-cont">
                            <div class="j-foodname foodname">辣子鸡饭</div>
                            <div class="j-item-console foodop clearfix">
                                <a class="food-yd"  href="">
                               	预定
                                </a>
                            </div>
                            <div class="food-price-region">
                            	<span class="food-price">{$setting['currency']}<font>22</font></span>
                            </div>
                        </div>
                       	</div>
                    </li>
                    <li class="j-fooditem fooditem" style="padding-top:0px;">
                    <div class="food-content1 clearfix">
                        <div class="food-pic-wrap">
                        <img class="j-food-pic food-pic" src="../image/sp1.jpg" visibility="hidden">
                        <span class="items-item-sold">621人吃过</span>
                        </div>
                        <div class="food-cont">
                            <div class="j-foodname foodname">辣子鸡饭</div>
                            <div class="j-item-console foodop clearfix">
                                <a class="j-add-item add-food" href="javascript:;">
                               		<i class="icon i-add-food j-add-inner"></i>
                                </a>
                                <span class="j-item-num foodop-num" style="display:none">0</span>
                                <a class="j-remove-item remove-food" style="display:none" href="javascript:;">
                                	<i class="icon i-remove-food"></i>
                                </a>
                            </div>
                            <div class="food-price-region">
                            	<span class="food-price">{$setting['currency']}<font>13</font></span>
                            </div>
                        </div>
                       	</div>
                    </li>
                  </ul>
           
                  <h3 class="foodlist-label">品牌专区 </h3>
                <ul>
                	 <li class="j-fooditem fooditem">
                    <div class="food-content1 clearfix">
                        <div class="food-pic-wrap">
                        <img class="j-food-pic food-pic" src="../image/sp2.jpg" visibility="hidden">
                        </div>
                        <div class="food-cont">
                            <div class="j-foodname foodname">辣子鸡饭</div>
                            <div class="j-item-console foodop clearfix">
                                 <a class="food-yd"  href="">
                               	预定
                                </a>
                            </div>
                            <div class="food-price-region">
                            	<span class="food-price">{$setting['currency']}<font>22</font></span>
                            </div>
                        </div>
                       	</div>
                    </li>
                    <li class="j-fooditem fooditem" style="padding-top:0px;">
                    <div class="food-content1 clearfix">
                        <div class="food-pic-wrap">
                        <img class="j-food-pic food-pic" src="../image/sp1.jpg" visibility="hidden">
                        </div>
                        <div class="food-cont">
                            <div class="j-foodname foodname">辣子鸡饭</div>
                            <div class="j-item-console foodop clearfix">
                                <a class="j-add-item add-food" href="javascript:;">
                               		<i class="icon i-add-food j-add-inner"></i>
                                </a>
                                <span class="j-item-num foodop-num" style="display:none">0</span>
                                <a class="j-remove-item remove-food" style="display:none" href="javascript:;">
                                	<i class="icon i-remove-food"></i>
                                </a>
                            </div>
                            <div class="food-price-region">
                            	<span class="food-price">{$setting['currency']}<font>13</font></span>
                            </div>
                        </div>
                       	</div>
                    </li>
                  </ul>
                
                   <h3 class="foodlist-label">套餐区 </h3>
                <ul>
                	 <li class="j-fooditem fooditem">
                    <div class="food-content1 clearfix">
                        <div class="food-pic-wrap">
                        <img class="j-food-pic food-pic" src="../image/sp2.jpg" visibility="hidden">
                        </div>
                        <div class="food-cont">
                            <div class="j-foodname foodname">辣子鸡饭</div>
                            <div class="j-item-console foodop clearfix">
                                <a class="j-add-item add-food" href="javascript:;" >
                               		<i class="icon i-add-food j-add-inner"></i>
                                </a>
                                <span class="j-item-num foodop-num" style="display:none">0</span>
                                <a class="j-remove-item remove-food" style="display:none" href="javascript:;">
                                	<i class="icon i-remove-food"></i>
                                </a>
                            </div>
                            <div class="food-price-region">
                            	<span class="food-price">{$setting['currency']}<font>22</font></span>
                            </div>
                        </div>
                       	</div>
                    </li>
                    <li class="j-fooditem fooditem" style="padding-top:0px;">
                    <div class="food-content1 clearfix">
                        <div class="food-pic-wrap">
                        <img class="j-food-pic food-pic" src="../image/sp1.jpg" visibility="hidden">
                        </div>
                        <div class="food-cont">
                            <div class="j-foodname foodname">辣子鸡饭</div>
                            <div class="j-item-console foodop clearfix">
                                <a class="j-add-item add-food" href="javascript:;">
                               		<i class="icon i-add-food j-add-inner"></i>
                                </a>
                                <span class="j-item-num foodop-num" style="display:none">0</span>
                                <a class="j-remove-item remove-food" style="display:none" href="javascript:;">
                                	<i class="icon i-remove-food"></i>
                                </a>
                            </div>
                            <div class="food-price-region">
                            	<span class="food-price">{$setting['currency']}<font>13</font></span>
                            </div>
                        </div>
                       	</div>
                    </li>
                  </ul>
                
                <h3 class="foodlist-label">配餐区 </h3>
                <ul>
                	 <li class="j-fooditem fooditem">
                    <div class="food-content1 clearfix">
                        <div class="food-pic-wrap">
                        <img class="j-food-pic food-pic" src="../image/sp2.jpg" visibility="hidden">
                        </div>
                        <div class="food-cont">
                            <div class="j-foodname foodname">辣子鸡饭</div>
                            <div class="j-item-console foodop clearfix">
                                <a class="food-yd"  href="">
                               	可选规格
                                </a>
                            </div>
                            <div class="food-price-region">
                            	<span class="food-price">{$setting['currency']}<font>22</font></span>
                            </div>
                        </div>
                       	</div>
                    </li>
                    <li class="j-fooditem fooditem" style="padding-top:0px;">
                    <div class="food-content1 clearfix">
                        <div class="food-pic-wrap">
                        <img class="j-food-pic food-pic" src="../image/sp1.jpg" visibility="hidden">
                        </div>
                        <div class="food-cont">
                            <div class="j-foodname foodname">辣子鸡饭</div>
                            <div class="j-item-console foodop clearfix">
                                <a class="j-add-item add-food" href="javascript:;">
                               		<i class="icon i-add-food j-add-inner"></i>
                                </a>
                                <span class="j-item-num foodop-num" style="display:none">0</span>
                                <a class="j-remove-item remove-food" style="display:none" href="javascript:;">
                                	<i class="icon i-remove-food"></i>
                                </a>
                            </div>
                            <div class="food-price-region">
                            	<span class="food-price">{$setting['currency']}<font>13</font></span>
                            </div>
                        </div>
                       	</div>
                    </li>
                  </ul>
               
                   <h3 class="foodlist-label">甜品区 </h3>
                <ul>
                	 <li class="j-fooditem fooditem">
                    <div class="food-content1 clearfix">
                        <div class="food-pic-wrap">
                        <img class="j-food-pic food-pic" src="../image/sp2.jpg" visibility="hidden">
                        </div>
                        <div class="food-cont">
                            <div class="j-foodname foodname">辣子鸡饭</div>
                            <div class="j-item-console foodop clearfix">
                                <a class="j-add-item add-food" href="javascript:;" >
                               		<i class="icon i-add-food j-add-inner"></i>
                                </a>
                                <span class="j-item-num foodop-num" style="display:none">0</span>
                                <a class="j-remove-item remove-food" style="display:none" href="javascript:;">
                                	<i class="icon i-remove-food"></i>
                                </a>
                            </div>
                            <div class="food-price-region">
                            	<span class="food-price">{$setting['currency']}<font>22</font></span>
                            </div>
                        </div>
                       	</div>
                    </li>
                    <li class="j-fooditem fooditem" style="padding-top:0px;">
                    <div class="food-content1 clearfix">
                        <div class="food-pic-wrap">
                        <img class="j-food-pic food-pic" src="../image/sp1.jpg" visibility="hidden">
                        </div>
                        <div class="food-cont">
                            <div class="j-foodname foodname">辣子鸡饭</div>
                            <div class="j-item-console foodop clearfix">
                                <a class="j-add-item add-food" href="javascript:;">
                               		<i class="icon i-add-food j-add-inner"></i>
                                </a>
                                <span class="j-item-num foodop-num" style="display:none">0</span>
                                <a class="j-remove-item remove-food" style="display:none" href="javascript:;">
                                	<i class="icon i-remove-food"></i>
                                </a>
                            </div>
                            <div class="food-price-region">
                            	<span class="food-price">{$setting['currency']}<font>13</font></span>
                            </div>
                        </div>
                       	</div>
                    </li>
                     <li class="j-fooditem fooditem" style="padding-top:0px;">
                    <div class="food-content1 clearfix">
                        <div class="food-pic-wrap">
                        <img class="j-food-pic food-pic" src="../image/sp1.jpg" visibility="hidden">
                        </div>
                        <div class="food-cont">
                            <div class="j-foodname foodname">辣子鸡饭</div>
                            <div class="j-item-console foodop clearfix">
                                <a class="j-add-item add-food" href="javascript:;">
                               		<i class="icon i-add-food j-add-inner"></i>
                                </a>
                                <span class="j-item-num foodop-num" style="display:none">0</span>
                                <a class="j-remove-item remove-food" style="display:none" href="javascript:;">
                                	<i class="icon i-remove-food"></i>
                                </a>
                            </div>
                            <div class="food-price-region">
                            	<span class="food-price">{$setting['currency']}<font>13</font></span>
                            </div>
                        </div>
                       	</div>
                    </li>
                  </ul>
                              
             </div>
         </div>    

    <div id="cart" class="cart">
        <div class="cart-tip">
            <div class="j-cart-icon cart-icon">
                <i class="j-ico-cart ico-cart" id="add-cart"></i>
                <div class="j-cart-num cart-num">0</div>
       		</div>
           
            <div class="j-cart-noempty cart-noempty">
                <span class="j-cart-price cart-price">共 {$setting['currency']}<font></font></span>
                <del class="j-cart-origin cart-origin"></del>
                <br>
            </div>
            
            <div class="j-cart-empty cart-empty" style="display: block;">购物车空空如也～</div>
    	</div>
        <div class="cart-btns" style="display:none">
            <a class="cart-btn-unavail" href="javascript:;">
                <span class="combtn inner">休息中</span>
            </a>
        </div>
        <div class="cart-btns" style="">
            <a class="j-cart-btn-confirm cart-btn-confirm" style="display:none" href="javascript:;">
                <span class="inner">我选好了</span>
            </a>
            <a class="j-cart-btn-unavail cart-btn-unavail">
                <span class="inner">点菜中</span>
            </a>
            </div>
        </div>
</div>

<!--购物车列表-->
	<div class="shop-cart"></div>
	<div class="cart-list">
    	 <div class="cart-header">
                <i class="cart-b">
                <div class="cart-n">6</div>
                </i>
       	 </div>
    	<div class="popup-cart-actions">
            <button class="button popup-cart-clear-btn">清空购物车</button> 
            <span>购物车</span>
        </div>
        
        <div class="native-scroll">
            <ul>
                <li>
                    <div class="cart-item-name">情痴羊蝎子单品</div>
                    <div class="cart-item-price">{$setting['currency']}<font>98.00</font></div>
                    <div class="cart-item-num">
                            <i class="cart-item-add"></i>
                        	<span>1</span>
                            <i class="cart-item-jj"></i>
                    </div>
                 </li>
                  <li>
                    <div class="cart-item-name">情痴羊蝎子单品</div>
                    <div class="cart-item-price">{$setting['currency']}<font>98.00</font></div>
                    <div class="cart-item-num">
                            <i class="cart-item-add"></i>
                        	<span>1</span>
                            <i class="cart-item-jj"></i>
                    </div>
                 </li>
                 <li>
                    <div class="cart-item-name">情痴羊蝎子单品</div>
                    <div class="cart-item-price">{$setting['currency']}<font>98.00</font></div>
                    <div class="cart-item-num">
                            <i class="cart-item-add"></i>
                        	<span>1</span>
                            <i class="cart-item-jj"></i>
                    </div>
                 </li>
                  <li>
                    <div class="cart-item-name">情痴羊蝎子单品</div>
                    <div class="cart-item-price">{$setting['currency']}<font>98.00</font></div>
                    <div class="cart-item-num">
                            <i class="cart-item-add"></i>
                        	<span>1</span>
                            <i class="cart-item-jj"></i>
                    </div>
                 </li>
                 <li>
                    <div class="cart-item-name">情痴羊蝎子单品</div>
                    <div class="cart-item-price">{$setting['currency']}<font>98.00</font></div>
                    <div class="cart-item-num">
                            <i class="cart-item-add"></i>
                        	<span>1</span>
                            <i class="cart-item-jj"></i>
                    </div>
                 </li>
                  <li>
                    <div class="cart-item-name">情痴羊蝎子单品</div>
                    <div class="cart-item-price">{$setting['currency']}<font>98.00</font></div>
                    <div class="cart-item-num">
                            <i class="cart-item-add"></i>
                        	<span>1</span>
                            <i class="cart-item-jj"></i>
                    </div>
                 </li>
                 
             </ul>
         </div>
         <div class="cart-footer">
         	<div class="cart-fl">
            	共 {$setting['currency']}<strong>588.00</strong>
            </div>
            <button>我选好了</button>
         </div>
        
	</div>

<script src="../script/fly.min.js"></script>
<script>
$(document).scroll(function(){
	 var ftop = $(document).scrollTop();
	 var cate=7;
	 for(var i=1;i<cate;i++){
		 var fheighti=$('.foodlistwrap h3').eq(i).offset();
		 var hi=fheighti.top-186;
		  if(ftop>hi){
			 $('.tag').removeClass('focus')
			 $('.tag').eq(i).addClass('focus')
	  	  }
		  if(i==1){
			  if(ftop<hi){
				 $('.tag').removeClass('focus')
				 $('.tag').eq(0).addClass('focus')
			  }
		  }
	 }
	

    });
$(function() { 
//导航菜单
	$('.tag').click(function(e) {
		$('.tag').removeClass('focus')
		$(this).addClass('focus')
		var ind=$(this).index()//data-group-id
		var scroll_offset=$('.foodlistwrap h3').eq(ind).offset();
		$('html,body').animate({
		   scrollTop: scroll_offset.top-86  //让mainwrap的scrollTop等于pos的top，就实现了滚动
		   },500);		
	})

    var offset = $("#add-cart").offset();	
	var lastClickTime = new Date().getTime();
	var delay = 1000; // 解决延迟 联系点击bug 
    $(".add-food").click(function(event) { 
		if (new Date().getTime() - lastClickTime < delay) {
			return;
	  	}
	  	lastClickTime = new Date().getTime();
  
        var img = $(this).parent().parent().parent().find('img').attr('src'); //获取当前点击图片链接 
        var flyer = $('<img class="flyer-img" src="' + img + '">'); //抛物体对象				
		var sum=$(this).parent().find('.foodop-num').text();
		if(sum==0){
			sum=1;
		}else{
			sum++
		}
		var fnum=$(this).parent().find('.foodop-num');
		var jian=$(this).parent().find('.remove-food');
		var car=$('#add-cart');//改变购物车背景
		var cartnum=$('.cart-num');//没有商品 空
		var carempty=$('.cart-empty');//有商品
		var goodsprice=$(this).parent().next().find('font').text();//商品单价
		var cartnoempty=$('.cart-noempty');	//总价格位置
		var totalprice=$('.cart-noempty').find('font').text();//总价格
		if(totalprice!=0){
			totalprice=parseInt(totalprice)+parseInt(goodsprice);
			}else{
			totalprice=goodsprice;
		}
		
		var cartbtnconfirm=$('.cart-btn-confirm'); //结算
		var cartbtnunavail=$('.cart-btn-unavail'); //差10元起送

		var total=$('.cart-num').text();//总数
		total=parseInt(total)+1;
        flyer.fly({ 
            start: { 
                left: event.clientX-25,//抛物体起点横坐标 
                top: event.clientY-25 //抛物体起点纵坐标 
            }, 
            end: { 
                left: offset.left+10,//抛物体终点横坐标 
                top: offset.top+20, //抛物体终点纵坐标 
            }, 
            onEnd: function() { 
                fnum.css({"display":"block"});////成功加入购物车动画效果
				jian.css({"display":"block"});
				car.addClass('ico-cart-active');//购物车背景
				cartnum.css({"display":"block"}); 
				carempty.css({"display":"none"});//隐藏空空
				cartnoempty.css({"display":"block"});
				cartnoempty.find('font').text(totalprice) //总价
				cartbtnconfirm.css({"display":"block"});//结算
				cartbtnunavail.css({"display":"none"});//起送
				fnum.text(sum);//增加数量
				cartnum.text(total); //购物车商品总数
                this.destory(); //销毁抛物体 
            } 
        }); 
    });
	
	$(".remove-food").click(function(event) {
		if (new Date().getTime() - lastClickTime < delay) {
			return;
	  	}
	  	lastClickTime = new Date().getTime();	
		var fnum=$(this).parent().find('.foodop-num'); 
		var sum=$(this).parent().find('.foodop-num').text();//商品数量
		var jian=$(this).parent().find('.remove-food');
		sum--;
		if(sum<1){
			fnum.css({"display":"none"});
			jian.css({"display":"none"});
		}
		fnum.text(sum)
		var cartnum=$('.cart-num').text();//商品总数减1
		
		var car=$('#add-cart');//改变购物车背景
		cartnum=cartnum-1;
		if(cartnum<1){	
			car.removeClass('ico-cart-active');
			$('.cart-num').css({"display":"none"}) 						
		}
		$('.cart-num').text(cartnum); 
		var totalprice=$('.cart-noempty').find('font').text();//总价钱
		var goodsprice=$(this).parent().next().find('font').text();//商品单价
		var carempty=$('.cart-empty');//有商品
		var cartnoempty=$('.cart-noempty');	//总价格位
		var cartbtnconfirm=$('.cart-btn-confirm'); //结算
		var cartbtnunavail=$('.cart-btn-unavail'); //差10元起送
		totalprice=parseInt(totalprice)-parseInt(goodsprice);
		if(totalprice==0){
			carempty.css({"display":"block"});
			cartnoempty.css({"display":"none"});
			cartbtnunavail.css({"display":"block"});//起送
			cartbtnconfirm.css({"display":"none"});	
		}
		$('.cart-noempty').find('font').text(totalprice);		
		
	});
	
//计算购物车商品
	$('.cart-item-add').click(function(e) {
			var goodsnum=$(this).next().text();			
			goodsnum=parseInt(goodsnum)+1;
			$(this).next().text(goodsnum);
			
			var carttotal=$('.cart-fl strong').text()//总价
			var cartprice=$('.cart-item-price font').text()//单价
			carttotal=parseInt(carttotal)+parseInt(cartprice);
			$('.cart-fl strong').text(carttotal)
			var zongshu=$('.cart-n').text();
			zongshu=parseInt(zongshu)+1;
			$('.cart-n').text(zongshu);
    });
	$('.cart-item-jj').click(function(e) {
			var goodsnum=$(this).prev().text();			
			goodsnum=parseInt(goodsnum)-1;
			$(this).prev().text(goodsnum);
			if(goodsnum==0){
				$(this).parent().parent().css({"display":"none"})
				$(this).next().text(0);
				}			
			var carttotal=$('.cart-fl strong').text()//总价
			var cartprice=$('.cart-item-price font').text()//单价
			carttotal=parseInt(carttotal)-parseInt(cartprice);
			$('.cart-fl strong').text(carttotal)
			var zongshu=$('.cart-n').text();
			zongshu=parseInt(zongshu)-1;
			if(zongshu==0){
				$('.shop-cart').css({"display":"none"})
				$('.cart-list').slideUp(200)
				}
			$('.cart-n').text(zongshu);
    });
	
	$('#add-cart').click(function(e) {
        var cartnum=$('.cart-num').text();
		if(cartnum>0){
			$('.shop-cart').css({"display":"block"});
			$('.cart-list').slideDown(400)
			$('.cart-list').css({"overflow":""})	
		}
    });
	$('.shop-cart').click(function(e) {
			$(this).css({"display":"none"})
			$('.cart-list').slideUp(200)	

    });

});

</script>


<div class="top-btn" style="display: block;">
<a class="react">
    <i class="text-icon">⇧</i>
</a>
</div>
    <script>

    //top行为
    $('.top-btn').on('click',function(){
    $("html, body").animate({ scrollTop: 0 }, "slow");
    });
    if ($(document).scrollTop() == 0) {
    $('.top-btn').css('display','none');
    }
    $(document).bind('scroll',function() {
    if ($(document).scrollTop() == 0) {
    $('.top-btn').css('display','none');
    }else{
    $('.top-btn').css('display','block');
    }
    })	
	
	</script>

<script src="../script/fakeLoader.min.js"></script>
<script type="text/javascript">
$(document).ready(function(){
    $(".fakeloader").fakeLoader({
        timeToHide:1200,
        bgColor:"#1abc9c",
        spinner:"spinner6"
    });
});
</script>    
	</body>
</html>
